# Lines with '#' are comments that are not executed # This file contains an example of an "auto greet" function. # Whenever someone joins the channel that you specify in the greetchannel # variable, the script will say "Welcome to " # This is actually fairly obnoxious. Most people disprove of auto greets # and it is only included here as an example # To automatically load this into a connection, add "/load OnJoin" to the startup actions. # This line creates a variable that holds the name of the channel # that the function operates on. assign greetchannel #chatzone # The next part is the actual event handler script. Snak calls the handler # when someone joins any channel that you are a member of. # Input: # $0 : nick!userhost # $1 : channel name # First the script tests if the channel name is the one it should react to. # then it formats a message that is sent to the channel, welcoming the new user. # In order for you to see what it does it also writes the message to the window on -join * { if ([$1] == [$greetchannel]) { quote PRIVMSG $1 :Welcome to $1 $nickonly($0) echo Welcome to $1 $nickonly($0) } } # The character in front of the join determines how Snak continues processing. # A '^' stops further processing of the event. # A '-' lets Snak continue processing. This will cause the normal join # message to appear: " has joined the channel". # This script uses the $nickonly function from the Basical script file. # The function splits the nick!userhost string and returns the nick. # The echo function will display the text locally # The say function will send the text to the channel